{% extends "base.html" %} 

{% block title %}根据用户找此用户购买的商品{% endblock %} 

{% block content %}

    <h2>用户名:{{ user.username}}</h2>

    <br>
    此用户购买的商品如下:
    <!-- goods模型中的：users = db.relationship('User', 
     backref='goodslist',secondary='user_goods') -->

     <!-- goodslist就是商品模型的relationship，和user_goods表关联 -->
    {% for goods in user.goodslist %}
        <p>
             {{ goods.gname}} -- {{ goods.price }}
        </p>
    {% endfor %}
{% endblock %}
